<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>王者荣耀案例</title>
    <!-- 引入vue.js -->
    <script src="./node_modules/vue/dist/vue.global.js"></script>
    <!-- 引入css样式 -->
    <link rel="stylesheet" href="./src/assets/index.css">
    <!-- 引入axios文件 -->
     <script src="./node_modules/axios/dist/axios.min.js"></script>
     <!-- 引入lodash文件 -->
     <script src="../node_modules/lodash/lodash.min.js"></script>
</head>
<body>
        <!-- 创建页面容器 -->
    <div id="app">
      <div class="container">
        <!-- 上面搜索部分 -->
        <div class="search">
          <div class="title">
            <p>综合</p>
            <p>定位</p>
          </div>
          <div class="types">
            <!-- value是里面的数据,[],key是键名,zonghe,zingwei -->
            <div class="type-list" v-for="(value,key) in typeList" :key="key">
              <div class="radio"   v-for="(item,index) in value" :class="{checked:query.value ===item.value}" @click="changeType(key,item.value)">{{item.name}}</div>
            </div>
          </div>
          <div class="keyword">
            <div class="input"> 
                <!-- 这里不能用v-model,因为之前条件查询同时更改了key和value,这里新增了keywords的处理,只能分开写 -->
              <input type="text" placeholder="请输入你要搜索的英雄名" :value="keywords" @input="changeKeywords"/>
            </div>
          </div>
        </div>

        <!-- 下面列表展示部分 -->
        <ul class="list">
          <li v-for="hero in filterHeros"  :key="hero.id_name">
            <a :href="getHeroUrl(hero.ename)" target="_blank">
              <img :src="getHeroImg(hero.ename)" />
              <span v-html="hero.cname"></span>
            </a>
          </li>
        </ul>
      </div>
    </div>

    <!-- 引入js文件 -->
    <script src="/src/js/index.js"></script>
</body>
</html>